<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="col-sm-12">
			<div class="ibox">
				<div class="ibox-body">
					<div class="fixed-table-toolbar">
						<div class="columns pull-right" role="group">
							<button class="btn btn-success" onclick="reLoad()">
								<i class="fa fa-search" aria-hidden="true"></i>查询
							</button>
							<button class="btn btn-danger" shiro:hasPermission="sales:order:export" onclick="exportWorkOrders()">
								<i class="fa fa-mail-reply-all" aria-hidden="true"></i>导出
							</button>
						</div>

						<div class="pull-right search col-md-1 nopadding">
							<input id="queryItem" type="text" class="form-control" placeholder="门店姓名/ID/工单号">
						</div>
						<div class="pull-right search col-md-1 nopadding">
							<input id="supplyName" type="text" class="form-control" placeholder="供应商名称">
						</div>
						<div class="columns pull-right col-md-1 nopadding">
							<input type="text" class=" form-control"
								   id="end" name="end" placeholder="请选择结束日期"
								   onclick="laydate({istime: false, format: 'YYYY-MM-DD'})"
								   style="background-color: #fff;" readonly="readonly"/>
						</div>

						<div class="columns pull-right">
							<label style="font-weight: 700;float: left;padding: 3px 10px;line-height: 2;font-size: 15px">
								<i class="fa fa-exchange"></i>
							</label>
						</div>

						<div class="columns pull-right col-md-1 nopadding">
							<input type="text" class=" form-control"
								   id="start" name="start" placeholder="请选择开始日期"
								   onclick="laydate({istime: false, format: 'YYYY-MM-DD'})"
								   style="background-color: #fff;" readonly="readonly"/>
						</div>

						<div class="columns pull-right col-md-1 nopadding">
							<select data-placeholder="工单状态" class="form-control chosen-select" id="status" name="status" tabindex="2">
								<option value="">选择工单状态</option>
								<option th:each="item: ${statusList}" th:text="${item.desc}" th:value="${item.code}"></option>
							</select>
						</div>

						<input type="hidden" name="centreId" th:value="${centreId}" th:if="${flag} == '1'">
						<div class="columns pull-right col-md-1 nopadding" th:if="${flag} == '0'">
							<select data-placeholder="商户" class="form-control chosen-select" name="centreId" tabindex="2">
								<option value="">选择商户</option>
								<option th:each="item: ${centreList}" th:text="${item.name}" th:value="${item.centreId}"></option>
							</select>
						</div>

						<div class="columns pull-right col-md-1 nopadding">
							<input type="text" class=" form-control"
								   id="payTimeEnd" name="payTimeEnd" placeholder="完成日期"
								   onclick="laydate({istime: false, format: 'YYYY-MM-DD'})"
								   style="background-color: #fff;" readonly="readonly"/>
						</div>

						<div class="columns pull-right">
							<label style="font-weight: 700;float: left;padding: 3px 10px;line-height: 2;font-size: 15px">
								<i class="fa fa-exchange"></i>
							</label>
						</div>

						<div class="columns pull-right col-md-1 nopadding">
							<input type="text" class=" form-control"
								   id="payTimeStart" name="payTimeStart" placeholder="完成日期"
								   onclick="laydate({istime: false, format: 'YYYY-MM-DD'})"
								   style="background-color: #fff;" readonly="readonly"/>
						</div>

						<div shiro:hasPermission="sales:order:saveOutTime" class="pull-left search col-md-2 nopadding" th:if="${flag} == '1'">
							<div class="col-sm-7" style=" padding-right: 0px;">
								<input id="outTime" value="48" type="number" min="0" class="form-control" placeholder="工单超时小时">
							</div>
							<div class="col-sm-5" style="padding-left: 0px;">
								<button class="btn btn-info" onclick="saveOutTime()">
									<i class="fa fa-check" aria-hidden="true"></i>售后时效
								</button>
							</div>
						</div>
					</div>
					<input type="hidden" th:value="${imgPrefix}" id="definePrefix">
					<table id="workOrderTable" data-mobile-responsive="true"></table>
					<div class="fixed-table-toolbar">
						  <h3>售后工单总计: <input id="sumMoney">  </h3> 
				    </div>
				</div>
			</div>
		</div>

		<div>
			<script type="text/javascript">
				var s_reply_h = 'hidden';
				var s_forward_h = 'hidden';
				var s_close_h = 'hidden';
				var s_remove_h = 'hidden';
			</script>
		</div>
		<div shiro:hasPermission="sales:order:reply">
			<script type="text/javascript">
				var s_reply_h = '';
			</script>
		</div>
		<div shiro:hasPermission="sales:order:forward">
			<script type="text/javascript">
				var s_forward_h = '';
			</script>
		</div>
		<div shiro:hasPermission="sales:order:close">
			<script type="text/javascript">
				var s_close_h = '';
			</script>
		</div>
		<div shiro:hasPermission="sales:order:remove">
			<script type="text/javascript">
				var s_remove_h = '';
			</script>
		</div>
	</div>
	<div th:include="include :: footer"></div>
	<script type="text/javascript" src="/js/appjs/workorder/order/orders.js"></script>
</body>
</html>